class Person:
    def __init__(self,age,name):
        self.__age =age
        self.name =name
    def run(self):
        print("正在跑步")
    def getAge(self):
        return self.__age
    def setAge(self,age):
        if age>0and age<100:
            self.__age =age
        else:
            print("您输入的年龄有误，我们将给您一个默认的值")
            self.__age=18
p1 = Person(12,"coco")
newAge = p1.getAge()
print(newAge)
p1.setAge(2000)
newAge =p1.getAge()
print(newAge)












